/**
 * 提现记录
 */

import 'package:cbec_app/components/base/base_page.dart';
import 'package:cbec_app/components/common/common_style.dart';
import 'package:cbec_app/components/base/base_nav_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class CostLog extends StatefulWidget {
  const CostLog({super.key});

  @override
  State<CostLog> createState() => _WithDrawLogState();
}

class _WithDrawLogState extends State<CostLog> {
  @override
  Widget build(BuildContext context) {
    return BasePage(
      title: "消费记录",
      iconType: IconType.back,
      children: [
        Container(
          height: 600.h,
            margin: EdgeInsets.only(top: 10.w),
            color: Colors.white,
            child: ListView(
              children: [
                  CostLogItem(title: "订单支出", surplus: "12.23", orderSn: "3434234554232", time: "2023-03-15 15:17:38", amount: "22", cardNo: "454342253423"),
                  CostLogItem(title: "订单支出", surplus: "12.23", orderSn: "3434234554232", time: "2023-03-15 15:17:38", amount: "22", cardNo: "454342253423"),
                  CostLogItem(title: "订单支出", surplus: "12.23", orderSn: "3434234554232", time: "2023-03-15 15:17:38", amount: "22", cardNo: "454342253423"),
              ],
            ),
        )
      ],
    );
  }
}


/**
 * 提现记录item
 */
class CostLogItem extends StatelessWidget {
    final String title;//标题
    final String surplus;//剩余金额
    final String orderSn;//订单号
    final String cardNo;
    final String time;//金额时间
    final String amount;//金额

  const CostLogItem({super.key, required this.title, required this.surplus, required this.orderSn, required this.time, required this.amount, required this.cardNo});
    final TextStyle titleStyle = const TextStyle(fontSize: 12,fontWeight: FontWeight.bold,color: Colors.black);
    final TextStyle surplusTitleStyle = const TextStyle(fontSize: 10,fontWeight: FontWeight.bold,color: Colors.black);
    final TextStyle subTitleStyle = const TextStyle(fontSize: 10,fontWeight: FontWeight.w400,color: Color.fromRGBO(153, 153, 153, 1));
    final TextStyle amountTitileStyle = const TextStyle(fontSize: 14,fontWeight: FontWeight.w700,color: Color.fromRGBO(7, 193, 96, 1));

    // final TextStyle states3 = const TextStyle(fontSize: 10,fontWeight: FontWeight.w400,color: Color.fromRGBO(248, 63, 45, 1));

    

  @override
  Widget build(BuildContext context) {

    

    return Container(
      padding: EdgeInsets.all(18.w),
      decoration: bottom_gary_border,
      // height: 90.h,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          //左边是4列的文本
          SizedBox(
            // alignment: Alignment.topLeft,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(title,style: titleStyle,),
                SizedBox(height: 5.h,),
                Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [Text("到账后余额:",style: subTitleStyle,), Text("￥$surplus",style: surplusTitleStyle,)],
                ),
                SizedBox(height: 5.h,),
                Text("订单编号:$orderSn",style: subTitleStyle,),
                SizedBox(height: 5.h,),
                Text(time,style: subTitleStyle,),
                SizedBox(height: 5.h,),
                Text("预付卡卡号:$cardNo",style: subTitleStyle,),
              ],
            ),
          ),
          //右边的数字
          Column(
            children: [
             Text("-$amount",style: amountTitileStyle),
            ],
          )
        ],
      ),
    );
  }
}